Skip to content

2026 07 v1 cleanup#4470

Merged
laurelthorburn merged 13 commits into
2026-07-rcfrom
2026-07-v1-cleanup
May 22, 2026
Merged

2026 07 v1 cleanup#4470
laurelthorburn merged 13 commits into
2026-07-rcfrom
2026-07-v1-cleanup

Conversation

@laurelthorburn
Copy link
Copy Markdown
Contributor

@laurelthorburn laurelthorburn commented May 19, 2026

Closes https://github.com/shop/issues-learn/issues/1601

Background

Removing all @shopify/generate-docs v1 artifacts from the repo. The v1 generator consumes hand-authored .doc.ts files and emits generated_docs_data.json, generated_static_pages.json, and generated_category_pages.json. We've fully moved to v2, which reads @publicDocs JSDoc tags off the source .ts files and emits generated_docs_data_v2.json. The v1 files are dead weight — keeping them around invites accidental regressions and confuses contributors.

Solution

Scoped to 2026-07-rc (no changes to 2026-04 artifacts):

  • Bump @shopify/generate-docs to 1.2.2 — the latest stable release; v2-only CLI surface.

  • Delete all .doc.ts files (~410 files across admin, checkout, customer-account, point-of-sale).

  • Delete v1 generated JSONs for 2026-07-rc and surface-level paths: generated_docs_data.json, generated_static_pages.json, generated_category_pages.json.

  • Delete v1 type-helper sidecars in src/ that consumed removed exports from generate-docs (ReferenceEntityTemplateSchema, CodeTabType, ExampleType, etc.):

    • src/docs/ (whole tree — component-definitions.ts, docs-type.ts, components/*.ts metadata sidecars)
    • src/surfaces/admin/docs-types.ts
    • src/surfaces/checkout/helper.docs.ts
    • docs/surfaces/checkout/reference/helper.docs.ts

    These were metadata-only files (name/description/category records) consumed exclusively by the deleted .doc.ts files. None of the real component source was touched.

  • Slim the four build scripts (admin, checkout, customer-account, point-of-sale) to v2-only:

    • Drop v1-specific flags (--isLandingPage, --isCategoryPage, --typesInput), the transformJson step, .doc.ts.doc.js tsc compile, and dead template helpers (htmlWrapper, jsxWrapper, etc.).
    • Drop the build-docs-fast.sh / build-docs-watch.sh checkout scripts (v1-only).
  • Stop copying screenshots to shopify-dev in every surface's build script.

  • Fix build-docs-targets-json.mjs (admin + POS) to locate output dirs via generated_docs_data_v2.json now that generated_docs_data.json is gone.

  • Fix buildTargetDts.tscopyComponentDefinitions now mkdirSync's the components build destination. Previously the dir existed only as a side effect of tsc emitting the now-deleted .doc.ts files; on a clean CI build with no .doc.ts files compiled, copyFileSync failed with ENOENT.

  • Fix yarn.lock — the @shopify/generate-docs@1.2.2 resolved URL had been pinned to npm.shopify.io (Shopify's internal registry) because of local .npmrc scope routing. Rewrote it to registry.npmjs.org so CI (which can't auth to the internal mirror) can install. Integrity sha512 is identical between registries.

  • Leave scaffolding alonecreate-doc-files.js, the gen-docs:admin workspace script, and tsconfig.docs.json are kept since they're authoring tools, not v1 build artifacts.

🎩

  • yarn docs:admin 2026-07-rc
  • yarn docs:checkout 2026-07-rc
  • yarn docs:customer-account 2026-07-rc
  • yarn docs:point-of-sale 2026-07-rc

Each should produce only generated_docs_data_v2.json + targets.json under the surface's versioned output dir, with no v1 files anywhere.

CI parity locally (clean build/ removed first): yarn lint, yarn type-check, yarn build, yarn test --no-watch all pass.

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

@github-actions
Copy link
Copy Markdown
Contributor

🚨🚨🚨 Docs migration in progress 🚨🚨🚨

We are actively migrating UI extension reference docs to MDX in the areas/platforms/shopify-dev zone of the monorepo. This impacts docs for the following surfaces:

During this migration, please be aware of the following:

.doc.ts files are being deprecated. Changes to .doc.ts files in this repo will not be reflected in the new MDX-based docs. If you need to update docs for a reference that has already been migrated, make your changes directly in the areas/platforms/shopify-dev zone of the monorepo instead.

Doc comments in .ts source files (the comment blocks above types and functions) are also affected. Generating docs from these comments currently requires a newer version of the @shopify/generate-docs library that isn't yet available. Updates to doc comments may not produce the expected output until the migration is complete.

Examples that previously lived in this repo are being moved to the areas/platforms/shopify-dev zone of the monorepo and should be authored there going forward.

What should I do?

  • If your PR includes changes to .doc.ts files, doc comments, or examples, please reach out to us in #devtools-proj-templated-refs so we can help ensure your updates are captured correctly.
  • If your PR is limited to source code changes (non-docs), you can ignore this notice.

Thanks for your patience while we complete the migration! 🙏

@laurelthorburn laurelthorburn marked this pull request as ready for review May 19, 2026 18:33
@laurelthorburn laurelthorburn requested a review from jgray7019 May 20, 2026 14:20
  - src/docs/ (entire tree — component-definitions.ts, docs-type.ts, components/*.ts) — v1 shared
  component schemas, all consumers were the .doc.ts files I deleted earlier
  - src/surfaces/admin/docs-types.ts — same
  - src/surfaces/checkout/helper.docs.ts — same
  - docs/surfaces/checkout/reference/helper.docs.ts — same
  src/surfaces/checkout/components/Abbreviation/Abbreviation.doc.ts), which incidentally created
  build/ts/surfaces/checkout/components/ as a side effect. copyComponentDefinitions in buildTargetDts.ts
  assumed that directory existed. With the .doc.ts files gone, tsc no longer creates the parent dir, so
  copyFileSync fails with ENOENT on the destination.
@laurelthorburn laurelthorburn mentioned this pull request May 20, 2026
2 tasks
@laurelthorburn laurelthorburn mentioned this pull request May 20, 2026
2 tasks
Copy link
Copy Markdown
Contributor

@jgray7019 jgray7019 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also delete the packages/ui-extensions/docs/surfaces/checkout/generated/generated_docs_data.json and packages/ui-extensions/docs/surfaces/checkout/generated/generated_static_pages.json ? 🙏

};

/*
Using JSX Builder to self-host Preact and Sucrase.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this code to build live previews? Are we good to delete this?

Copy link
Copy Markdown
Contributor Author

@laurelthorburn laurelthorburn May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Replying on Laurel's behalf — yes, safe to delete! jsxWrapper (plus htmlWrapper / createTemplate and friends) was the v1 live-preview HTML generator — it self-hosted Preact + Sucrase off cdn.shopify.com/shopifycloud/jsx-builder/ to render inline component previews. With the v2-only migration nothing in the repo calls it anymore, and the v2 docs pipeline doesn't render previews from this script. Polaris live previews on shopify.dev are served by a separate web-component system now.

Edit: docs/surfaces/admin/templates/jsx-render.html and templates/icon-renderer/* (plus the orphan tsconfigs, create-doc-files.js, ReadMe.md, and Icon/icon-data.json) are now also deleted in this PR — no follow-up needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ew robot dont be signing up for f/u's on my behalf

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -1,4233 +0,0 @@
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should there be a version of this next to generated_docs_data_v2.json?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Replying on Laurel's behalf — yep, the replacement lives right next to generated_docs_data_v2.json. After this PR, generated/ contains just:

generated/generated_docs_data_v2.json
generated/targets.json

The versioned subdir (generated/checkout_ui_extensions/<version>/targets.json) is gone; flat layout now matches admin / customer-account / POS.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I meant is you didn't actually generate the file in the right location, you just deleted the old ones

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Replying on Laurel's behalf — just verified by re-running yarn docs:checkout 2026-07-rc. The build writes targets.json to the flat location (packages/ui-extensions/docs/surfaces/checkout/generated/targets.json) and the output is byte-identical to what's currently committed on this branch — same git blob SHA e70e2b820f3ce39005457c7f34331f738dafc3f9.

The reason it doesn't show as an addition in this PR's diff: the flat generated/targets.json already exists on the base branch (2026-07-rc) from when the build script switched to flat output. This PR deletes the old versioned subdir (checkout_ui_extensions/2026-04/targets.json) that the new script no longer writes to, but the flat file was already in place upstream — so the diff is just the deletion. Re-running the build confirms it's in the right location with current content.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are so wrong MU WAH HA HA

@laurelthorburn laurelthorburn merged commit 4105e50 into 2026-07-rc May 22, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants